using System;
using System.Diagnostics;
using System.Security.Permissions;
using System.Text;

namespace Oracle.ManagedDataAccess.Client
{
	internal static class OraclePerfParams
	{
		internal enum CounterIndex
		{
			HardConnectsPerSecond,
			HardDisconnectsPerSecond,
			SoftConnectsPerSecond,
			SoftDisconnectsPerSecond,
			NumberOfActiveConnectionPools,
			NumberOfActiveConnections,
			NumberOfFreeConnections,
			NumberOfInactiveConnectionPools,
			NumberOfNonPooledConnections,
			NumberOfPooledConnections,
			NumberOfReclaimedConnections,
			NumberOfStasisConnections
		}

		[Flags]
		internal enum Counter : ushort
		{
			None = 0x0,
			HardConnectsPerSecond = 0x1,
			HardDisconnectsPerSecond = 0x2,
			SoftConnectsPerSecond = 0x4,
			SoftDisconnectsPerSecond = 0x8,
			NumberOfActiveConnectionPools = 0x10,
			NumberOfInactiveConnectionPools = 0x20,
			NumberOfActiveConnections = 0x40,
			NumberOfFreeConnections = 0x80,
			NumberOfPooledConnections = 0x100,
			NumberOfNonPooledConnections = 0x200,
			NumberOfReclaimedConnections = 0x400,
			NumberOfStasisConnections = 0x800
		}

		internal const byte MAX_COUNTERS = 12;

		internal const string HARD_CONNECTS_PER_SECOND = "HardConnectsPerSecond";

		internal const string HARD_DISCONNECTS_PER_SECOND = "HardDisconnectsPerSecond";

		internal const string SOFT_CONNECTS_PER_SECOND = "SoftConnectsPerSecond";

		internal const string SOFT_DISCONNECTS_PER_SECOND = "SoftDisconnectsPerSecond";

		internal const string NUMBER_OF_ACTIVE_CONNECTION_POOLS = "NumberOfActiveConnectionPools";

		internal const string NUMBER_OF_INACTIVE_CONNECTION_POOLS = "NumberOfInactiveConnectionPools";

		internal const string NUMBER_OF_ACTIVE_CONNECTIONS = "NumberOfActiveConnections";

		internal const string NUMBER_OF_FREE_CONNECTIONS = "NumberOfFreeConnections";

		internal const string NUMBER_OF_POOLED_CONNECTIONS = "NumberOfPooledConnections";

		internal const string NUMBER_OF_NON_POOLED_CONNECTIONS = "NumberOfNonPooledConnections";

		internal const string NUMBER_OF_RECLAIMED_CONNECTIONS = "NumberOfReclaimedConnections";

		internal const string NUMBER_OF_STASIS_CONNECTIONS = "NumberOfStasisConnections";

		internal const int LENGTH_OF_APPDOMAIN_NAME = 40;

		internal const int LENGTH_OF_POOL_NAME = 70;

		internal const int LENGTH_OF_INSTANCE_NAME = 16;

		internal const string CATEGORY_NAME = "ODP.NET, Core Driver";

		internal static readonly string m_appDomainPfcInstanceName;

		[SecurityPermission(SecurityAction.Assert, Unrestricted = true)]
		static OraclePerfParams()
		{
			m_appDomainPfcInstanceName = string.Empty;
			string text = AppDomain.CurrentDomain.FriendlyName;
			string text2 = new StringBuilder().Append("[").Append(Process.GetCurrentProcess().Id).Append(",")
				.Append(AppDomain.CurrentDomain.Id)
				.Append("]")
				.ToString();
			if (text.Length + text2.Length > 40)
			{
				text = text.Substring(0, 40 - text2.Length - 3) + "...";
			}
			m_appDomainPfcInstanceName = new StringBuilder().Append(text).Append(text2).Replace('/', '_')
				.ToString();
		}
	}
}
